//
//  SaleReportTableViewCell.m
//  fitnessmanage
//
//  Created by wujian on 2018/1/2.
//  Copyright © 2018年 zongquankeji. All rights reserved.
//

#import "SaleReportTableViewCell.h"

@implementation SaleReportTableViewCell

-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self) {
        
        /**
         类型Label
         */
        UILabel *typeLabel = [[UILabel alloc] init];
        typeLabel.font = MidBigFont;
        typeLabel.textColor = CSColorFromRGB(0x666666);
        typeLabel.textAlignment = NSTextAlignmentCenter;
        [self.contentView addSubview:typeLabel];
        self.typeLabel = typeLabel;
        
        /**
         节数
         */
        UILabel *countLabel = [[UILabel alloc] init];
        countLabel.font = MidBigFont;
        countLabel.textColor = CSColorFromRGB(0x666666);
        countLabel.textAlignment = NSTextAlignmentCenter;
        [self.contentView addSubview:countLabel];
        self.countLabel = countLabel;
        
        /**
         应收
         */
        UILabel *netReceiptLabel = [[UILabel alloc] init];
        netReceiptLabel.font = MidBigFont;
        netReceiptLabel.textColor = CSColorFromRGB(0x666666);
        netReceiptLabel.textAlignment = NSTextAlignmentCenter;
        [self.contentView addSubview:netReceiptLabel];
        self.netReceiptLabel = netReceiptLabel;
        
        /**
         实收
         */
        UILabel *receiveLabel = [[UILabel alloc] init];
        receiveLabel.font = MidBigFont;
        receiveLabel.textColor = CSColorFromRGB(0x666666);
        receiveLabel.textAlignment = NSTextAlignmentCenter;
        [self.contentView addSubview:receiveLabel];
        self.receiveLabel = receiveLabel;
        
        [self setConstraints];
    }
    
    return self;
    
}

-(void)setConstraints{
    
    /**
     类型Label
     */
    [self.typeLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(self.contentView);
        
        make.centerY.mas_equalTo(self.contentView);
        
        //make.bottom.mas_equalTo(self.contentView).offset(-10);
    }];
    
    [self.countLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(self.typeLabel.mas_right);
        
        make.top.height.width.mas_equalTo(self.typeLabel);
    }];
    
    /**
     应收
     */
    [self.netReceiptLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(self.countLabel.mas_right);
        
        make.top.height.width.mas_equalTo(self.typeLabel);
        
    }];
    
    /**
     实收
     */
    [self.receiveLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(self.netReceiptLabel.mas_right);
        
        make.top.height.width.mas_equalTo(self.typeLabel);
        
        make.right.mas_equalTo(self.contentView);
    }];
}

@end
